package zero.tech.games.trade.remote;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;

import zero.tech.core.data.Resp;
import zero.tech.games.api.RemoteTrade;
import zero.tech.games.trade.service.api.ITradeService;
@RestController
public class RemoteTradeImple implements RemoteTrade{
	@Autowired
	private ITradeService tradeService;
	@Override
	public Resp gameUpdateBatch(String order_id, int club_id, int game_id, String room_id, int rule_id,int room_times,String room_name,int total_times,
			String joiners, String joiners_ai,String gold_change_map_str,String water_map_str) {
		Map<Integer, Long> gold_change_map = JSONObject.parseObject(gold_change_map_str,new TypeReference<Map<Integer, Long>>(){});
		Map<Integer, Long> water_map = JSONObject.parseObject(water_map_str,new TypeReference<Map<Integer, Long>>(){});
		return tradeService.gameUpdateBatch(order_id,club_id,game_id,room_id,rule_id,room_times,room_name,total_times,joiners,joiners_ai,gold_change_map,water_map);
	}

}
